package com.witfortos.common.http

import com.witfortos.common.base.IBaseResponse

/**
 *   @auther : tan
 *   time   : 2020-07-10
 */
class ResponseThrowable : Exception {
    var responeCode: Int
    var responeMsg: String

    constructor(error: ERROR, e: Throwable? = null) : super(e) {
        responeCode = error.getKey()
        responeMsg = error.getValue()
    }

    constructor(code: Int, msg: String, e: Throwable? = null) : super(e) {
        this.responeCode = code
        this.responeMsg = msg
    }

    constructor(base: IBaseResponse<*>, e: Throwable? = null) : super(e) {
        this.responeCode = base.responeCode()
        this.responeMsg = base.responeMsg()
    }
}

